<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let str5 = 'http://www.baidu.com?a=10&b=20&c=30'

        console.log(str5.startsWith('http://') || str5.startsWith('https://'));

        let paramsStr = str5.split('?')[1]
        console.log(paramsStr);
        let params = paramsStr.split('&')
        console.log(params);
        let key = 'b'
        for (let i = 0; i < params.length; i++) {
            console.log(params[i]);
            let kv = params[i].split('=')
            console.log(kv);
            if (key === kv[0]) {
                console.log(kv[1]);
                break
            }
        }

    </script>
</body>

</html>